#include "udp_server.hpp"
#include "Dictionary.hpp"


int main(int argc,char* argv[]){
    if (argc != 2){
        LOG(FATAL) << "Use error, Please use ./server + port";
        exit(-1);
    }
    Dictionary d("./dictionary.txt");
    d.Init();
    d.debug();
    shared_ptr<udp_server> us = make_shared<udp_server>(stoi(argv[1]));
    us->InsertFunction([&d](const string& s){
        return d.Translate(s);
    });
    us->Init();
    us->Start();
    return 0;
}

